# pip install pywin32
# pip install pyttsx3
from win32com import client

class Calculator():
    def __speaker(content):
        speaker = client.Dispatch('SAPI.SpVoice')
        speaker.Speak(content)
    
    def speaker(plus_str):
        def outter(func):
            def inner(*args, **kwargs):
                args[0].__class__.__speaker(plus_str + str(args[1]))
                func(*args, **kwargs)
                return args[0]
            return inner
        return outter

    def __init__(self, init_value):
        self.__result = init_value
        self.__class__.__speaker(str(init_value))


    def clear(self):
        self.__class__.__speaker('清零')
        self.__result = 0
        return self

    def show(self):
        self.__class__.__speaker('等于' + str(self.__result))
        print(self.__result)
        return self

    @speaker('加上')
    def plus(self, value):
        self.__result += value

    @speaker('除以')
    def division(self, value):
        self.__result /= value

    @speaker('乘以')
    def multiply(self, value):
        self.__result *= value

    @speaker('除以')
    def subscribe(self, value):
        self.__result -= value

Calculator(10).plus(2).division(2).multiply(5). \
clear()
